Barcode Xpress 10 for .Net - User Guide > How To > Pass Image Data Between Different Accusoft Components |
Traditionally, transferring image data between Accusoft components has required passing the image data in a DIB format. But, beginning with the release of Barcode Xpress 8, we added new methods throughout our products which allow you to easily copy or transfer image data between different Accusoft objects with just a single method call.
Regardless of its product or component assembly, any Accusoft image class which supports easily sending its image data to another Accusoft object will implement two methods: CopyTo(object destination) and TransferTo(object destination). And any Accusoft image class which supports easily receiving this image data (that is, being the destination object) will be noted in its class documentation.
A CopyTo method makes a complete copy of the image data. When called, both the source and destination objects will contain their own separate copies of identical image data. A TransferTo method, on the other hand, completely transfers the image data from one object to another. When finished, the source object will no longer contain image data; the image will be owned by the destination object.
Within the Barcode Xpress component, there is only one class which supports receiving image data: the BarcodeXpress class.
Other Accusoft products may contain additional classes which can send and receive image data.
Even within just the Barcode Xpress component, you can use this new approach to easily copy or transfer image data from an ImagXpress object to a Barcode Xpress object.
Here's an example:
Pass image data from an ImagXpress object to a Barcode Xpress object |
Copy Code |
---|---|
// Create the BarcodeXpress component BarcodeXpress barcodeXpress1 = new BarcodeXpress(); // The SetSolutionName, SetSolutionKey and possibly the SetOEMLicenseKey method must be // called to distribute the runtime. Note that the SolutionName, SolutionKey, and // OEMLicenseKey values shown below are only examples. barcodeXpress1.Licensing.SetSolutionName("YourSolutionName"); barcodeXpress1.Licensing.SetSolutionKey(12345, 12345, 12345, 12345); barcodeXpress1.Licensing.SetOEMLicenseKey("1.0.AStringForOEMLicensingContactAccusoftSalesForMoreInformation..."); // Set barcode types for which to search barcodeXpress1.reader.BarcodeTypes = SetBarcodeType(); // Call Analyze to detect barcodes in image. // All detected barcodes will be returned to the array of Result objects. Result[] results = barcodeXpress1.reader.Analyze(imageXView1.Image); // See if we returned any results if (results.Length > 0) { // Display the results string strResult; strResult = ""; for (int i = 0; i < results.Length; i++) { Result curResult = (Accusoft.BarcodeXpressSdk.Result)results.GetValue(i); strResult += "Symbol #" + i + "\r" + "Type = " + curResult.BarcodeName + "\r"; strResult += "Value=" + curResult.BarcodeValue + "\r"; string strMsg = "Symbol #" + i + " - " + curResult.BarcodeData; } strResult += "\n"; MessageBox.Show(strResult, "Barcode Result", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("No Barcodes Found", "Barcode Result", MessageBoxButtons.OK, MessageBoxIcon.Warning); } // Dispose the instance of the Barcode Xpress component. barcodeXpress1.Dispose(); |